UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/HlaljqRpPZcrPcLSUwWjlMPtjz/oqQbUCqlF32h2k8=' 
WHERE 
  key_id = 'cfdea63c6188000fd703e27c6bf18e25d35e5f49c85fb8084a082a097135db97' 
  AND (
    token = '/HlaljqRpPZcrPcLSUwWjlMPtjz/oqQbUCqlF32h2k8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025