UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Hxu3/6VVX8DAz+D9l4v5ysJVDg6skvoqmIDAZWP0b8=' 
WHERE 
  key_id = '555bb66f949fa4cfd64083ff77e705a4b2ba487168a34abc6ed5dea0a0c495f3' 
  AND (
    token = '0Hxu3/6VVX8DAz+D9l4v5ysJVDg6skvoqmIDAZWP0b8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033