UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E8+Bnya74jei8g8w+7wL0U3aeVRFv8Wa3XZKhs9rs2E='
WHERE
key_id = '6405f5c8b212cd4722ebae69ba0776807be76015f6419b8b90263abc7da6d611'
AND (
token = 'E8+Bnya74jei8g8w+7wL0U3aeVRFv8Wa3XZKhs9rs2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)