UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+cKMqWUv2+BfDEeg1FrHGKZL9yfPlf+f3W7/lrA/Pt0='
WHERE
key_id = '66744c310e57030fbfe890b98be7ec80d38330554eaff8bc62cb302566b58893'
AND (
token = '+cKMqWUv2+BfDEeg1FrHGKZL9yfPlf+f3W7/lrA/Pt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)