UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cxx62qBN4tco6XTVTMjVx2ch5i9w83isaASUoZ5vyR4='
WHERE
key_id = '52c95ed85a03100128b16cf94de0b59575af76455ae7b5d7148ea1d4637352c2'
AND (
token = 'Cxx62qBN4tco6XTVTMjVx2ch5i9w83isaASUoZ5vyR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)