UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ydoexz1HQ8kidYQbOJ4YZXFcNVsrfevA8/Q4Kshb7mo='
WHERE
key_id = 'efd0986b757d255dce95c090c9566a1791f60e4131dfba84accd31e77ab653b1'
AND (
token = 'Ydoexz1HQ8kidYQbOJ4YZXFcNVsrfevA8/Q4Kshb7mo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)