UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ol4pKsJLCukViaeJXP0ncH2Bn5u2Hk9sZVs2T6ALS4U='
WHERE
key_id = '9b4aa052b4c425e8e25323ec05df7d4819ccc59cb6c90292cd5e1fcc12a92250'
AND (
token = 'ol4pKsJLCukViaeJXP0ncH2Bn5u2Hk9sZVs2T6ALS4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)