UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eEzDFDfeYEPZHq2kqaRZLhmEo0Yp23RcfMPCX06iJFU=' 
WHERE 
  key_id = '06ed5e43aa8df0040fbab2f056b0cae3fd674d79574ca22cfa6390c6a72a7510' 
  AND (
    token = 'eEzDFDfeYEPZHq2kqaRZLhmEo0Yp23RcfMPCX06iJFU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031