UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1yHFky23uweiTt36FzcZcdfh+bxcpDkEibpTT4CNGpU=' 
WHERE 
  key_id = '48cd0a240c3741b0b7d81b09a315933bb008021b402a9a4d14bcf2dc766fa9ec' 
  AND (
    token = '1yHFky23uweiTt36FzcZcdfh+bxcpDkEibpTT4CNGpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039