UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BDV+iN9xwfmTsQqdjKWp4Bn7chJb0aDncEYf0gzYgBE=' 
WHERE 
  key_id = 'ead3babdb4c7f99364d4d1ef2a944abf5b5c4aba40b552e613bd6aff81d2975b' 
  AND (
    token = 'BDV+iN9xwfmTsQqdjKWp4Bn7chJb0aDncEYf0gzYgBE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029