UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5u+FTCQE+onRrgCtrKsl7V67DXc5VrS+OffpGFXbHEU=' 
WHERE 
  key_id = 'c3472ecdb19d41a7c9b50513284023f748b554aee27e5e89d6ebc1a17b14059a' 
  AND (
    token = '5u+FTCQE+onRrgCtrKsl7V67DXc5VrS+OffpGFXbHEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022