UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0iwVi+2LHhjobiJ0Gjp3nAbhkcCVM5ZcerncHAq3vM0='
WHERE
key_id = 'fe1534283ca5f7355f97c9ca84e03f77599449825cf1fd9c9fbd32b5ba210418'
AND (
token = '0iwVi+2LHhjobiJ0Gjp3nAbhkcCVM5ZcerncHAq3vM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)