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