UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NBcUT/qEFB7RQTMAFlg4a38CpPEBrYTRn9w/rYlyHCo='
WHERE
key_id = '66b0a9ed79cadcbfc26348cb71622e75ed03692a8cdc4288bb4073960b9b0052'
AND (
token = 'NBcUT/qEFB7RQTMAFlg4a38CpPEBrYTRn9w/rYlyHCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)