UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0rxktTeB/DsJ1Uh/QlHoXD/662AsqkN3TKvoQzWss6c=' 
WHERE 
  key_id = '9ee020d22644d14171d6dc0f7f02c1de02597852ba84544cc17cf51b7cfb29d9' 
  AND (
    token = '0rxktTeB/DsJ1Uh/QlHoXD/662AsqkN3TKvoQzWss6c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042