UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uws7b/XbL1FZ8ExI4XRxyf/gYX8ENsMM4jymhbdCGyE='
WHERE
key_id = '1b6305c14966a8b8a61004a97e991f0eec6ea557100ef720174b9649bc603358'
AND (
token = 'uws7b/XbL1FZ8ExI4XRxyf/gYX8ENsMM4jymhbdCGyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)