UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ln3tK2SrDyJo2R529LtD0zJLka06ANTwM5/PsALMGJU='
WHERE
key_id = 'bff9cb4e6945b54e146ffa3d230fe04fd43f3a6a9ed9ef86facf36c0802c252c'
AND (
token = 'ln3tK2SrDyJo2R529LtD0zJLka06ANTwM5/PsALMGJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)