UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LjXBkmU9OSY3JM9GqIBzrkL0vzN5o903rfixARNCsTQ=' 
WHERE 
  key_id = 'e0cc0ca59ef0814e67747598a215bb3eaab5b7f9a5afb41cef37051e4c35bda1' 
  AND (
    token = 'LjXBkmU9OSY3JM9GqIBzrkL0vzN5o903rfixARNCsTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031