UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rpX5Ik5lSNtFwcfrCd3e8npm0oxz9bB9Ty5GPeDvPtc=' 
WHERE 
  key_id = '0bae9f0a2bb2fa3192148a7002d531cf51e274aff489ea426a9fb5ed1a555a9c' 
  AND (
    token = 'rpX5Ik5lSNtFwcfrCd3e8npm0oxz9bB9Ty5GPeDvPtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029