UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/jVps+zsMgdyJezyrzyDnZKgOjilwyvoOrrN1NIezzY=' 
WHERE 
  key_id = '991b0e072aa00505a1b5a6fc66a03d9b88f0653778865c4a7762819ab5806b32' 
  AND (
    token = '/jVps+zsMgdyJezyrzyDnZKgOjilwyvoOrrN1NIezzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046