UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lllWWVUaOepbkYDBn5RFi3JVfNYyd+BQraSVxYp2FkY='
WHERE
key_id = '43279c764bf3add77a5de24e163ed31528d02d7be855abf587b93f7b99fc6488'
AND (
token = 'lllWWVUaOepbkYDBn5RFi3JVfNYyd+BQraSVxYp2FkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)