UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/bEioFCdX0MtWtwE8EUnyO6KLH2iWiiWXAIdVXwKTzQ=' 
WHERE 
  key_id = '255df9bd89c122a6a4898afe4470e2648c0cf4008be23b8571746ef78e3cbb19' 
  AND (
    token = '/bEioFCdX0MtWtwE8EUnyO6KLH2iWiiWXAIdVXwKTzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024