UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UQJdcAewqkeLTxlDK2SzBk/5q2daYgSxFSNOG1scJkM=' 
WHERE 
  key_id = 'b32a859de208de2b57f9c5983f363aad349204cac90ebeb32c10382e82d4172f' 
  AND (
    token = 'UQJdcAewqkeLTxlDK2SzBk/5q2daYgSxFSNOG1scJkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029