UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wkz9qVFy+mZuLP+Mu7Be0z6WAIrGIIg/WmcpulgBpDk=' 
WHERE 
  key_id = 'e342797ca2adc73b76c0e286d9f7a6add43eec8d763e0ec1a4137b213fdd1f33' 
  AND (
    token = 'wkz9qVFy+mZuLP+Mu7Be0z6WAIrGIIg/WmcpulgBpDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036