UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xzRI56WzZtx5FUlYrnFXvgEYjwa6b5trL0cUmVO5XgM='
WHERE
key_id = '1360573b3e71684ce7402c8708e939b70d6c46cc91475a9b423d5ab3514a0d2c'
AND (
token = 'xzRI56WzZtx5FUlYrnFXvgEYjwa6b5trL0cUmVO5XgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)