UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RNfx1Hg+ZWkZgPXuzMZ4gykiADBzw4DF9/N2Qo4rBkQ=' 
WHERE 
  key_id = 'db6968bfcdc3234be5c737815f315d97053699e2f32dba0a9c05c010e3c4d89c' 
  AND (
    token = 'RNfx1Hg+ZWkZgPXuzMZ4gykiADBzw4DF9/N2Qo4rBkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028