UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ksTx6LzYmTRG5/YJzbNBnPIRLz9FFLCJCF2UsOoqho=' 
WHERE 
  key_id = '115b182bee868d5a8429fc9a81a8df7f798ba41d4369fd97013e2b52fab7a546' 
  AND (
    token = '8ksTx6LzYmTRG5/YJzbNBnPIRLz9FFLCJCF2UsOoqho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024