UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+OCu5hM44oVTGJybbG75bTPKiKk1eVmT5AsumejXul0='
WHERE
key_id = '209fa3b7224b5b4c599acb1088c38c13420cc488d06d2760eca25645be2dfcf1'
AND (
token = '+OCu5hM44oVTGJybbG75bTPKiKk1eVmT5AsumejXul0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)