UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UnjolzTvwUL1YMlfNIJiBaFiatbq0gL0Z5IwsTvxFwA='
WHERE
key_id = 'b08e7cd3f3c4c2564afef2f3aafccb15a79d5aaa218707e1ef3d94d724f72d3a'
AND (
token = 'UnjolzTvwUL1YMlfNIJiBaFiatbq0gL0Z5IwsTvxFwA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)