UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bdICPYMdaP/1wqJJewR8JNejbG+NlnFypJ9Ie+Tw6YM='
WHERE
key_id = '128344dd9e49480a3dd842e215efaf054f47c660d4430d2e9d3d059570c9035e'
AND (
token = 'bdICPYMdaP/1wqJJewR8JNejbG+NlnFypJ9Ie+Tw6YM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)