UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ufIaC3DXRMId0Q770n2XThcMUqLzK89at8hr3unRpq0='
WHERE
key_id = '4e947a63dc21e234e15629a59bf569edb7b3772b721585046fc545182aca9308'
AND (
token = 'ufIaC3DXRMId0Q770n2XThcMUqLzK89at8hr3unRpq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)