UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CgTcuBWs5vYSU1qCvpByeJTVk6cIpnMzk+/krEkKmrI='
WHERE
key_id = 'efff2a37f3ec3f89f45cbfe66206fd3d0cd204da1893ac4484c51bf3c328ca7f'
AND (
token = 'CgTcuBWs5vYSU1qCvpByeJTVk6cIpnMzk+/krEkKmrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)