UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KzAEs1CXsiKF65SJYj2JXZkoV/BIRSyQJvSy42z/oPQ=' 
WHERE 
  key_id = 'f05291888f2a8aadd07aeac5ff11eac76dd4b422ef13f0dbf1247d607dd280cf' 
  AND (
    token = 'KzAEs1CXsiKF65SJYj2JXZkoV/BIRSyQJvSy42z/oPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067