UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9mrn2BgRnsY0H4SYXeZFuV7KF4S7f8I+5Yix4i/1PDY=' 
WHERE 
  key_id = '941542fa40c14c945806ab21189877f55f3968b3a8ae8d8ffe01fcfdb220050b' 
  AND (
    token = '9mrn2BgRnsY0H4SYXeZFuV7KF4S7f8I+5Yix4i/1PDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034