UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'otsCUi2/VG0y9gdc+wZhmeDTsPIg2oWDfR1PJnNIP7Q='
WHERE
key_id = '251dc316fd78d7580122ed1773e223b5930c79d82f7d26a2a7f8b0349b776a0f'
AND (
token = 'otsCUi2/VG0y9gdc+wZhmeDTsPIg2oWDfR1PJnNIP7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)