UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0PjNvXnIbtxNfQDAtUyajplgqjR7HYCDnCRpiqHGSSY='
WHERE
key_id = 'b431dbd8b72870dbbd6a200b6112719c82b93663da139a82ad8fcfbe6a590bad'
AND (
token = '0PjNvXnIbtxNfQDAtUyajplgqjR7HYCDnCRpiqHGSSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)