UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WATSc2pJFRZEOoy82pWfHCtFQiOGU9yv/RRYjm4sLec=' 
WHERE 
  key_id = '7283e5148287c054e257acd03b6557537127d9f7e12e66a70dfa26de23725cf3' 
  AND (
    token = 'WATSc2pJFRZEOoy82pWfHCtFQiOGU9yv/RRYjm4sLec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026