UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43YmIZSJ9GpRlfhAX/PqJgCbXNlu7Bxc9YWof8NT544=' 
WHERE 
  key_id = 'e5c4e676872cb35a593803309cddfbc58c3436f04e2f8484808525fc698e0f84' 
  AND (
    token = '43YmIZSJ9GpRlfhAX/PqJgCbXNlu7Bxc9YWof8NT544=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058