UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wx2A59d8vf0oxByIUL62tIaR/0A4lTxQUn2qdp023z4=' 
WHERE 
  key_id = 'd4e860bfd7fb44013464b1c9e6c8596f9179c8f25c8cfa6b6240bd7e00ae7857' 
  AND (
    token = 'wx2A59d8vf0oxByIUL62tIaR/0A4lTxQUn2qdp023z4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031