UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'do3hvhd/R3qe2vmQIeP7DTEOD0jQIjjh6pQupiBVHRI=' 
WHERE 
  key_id = '029157c8b1e6f2751a095be9756b0b6d9335aba60700f0f9bc5677afac235b03' 
  AND (
    token = 'do3hvhd/R3qe2vmQIeP7DTEOD0jQIjjh6pQupiBVHRI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056