UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2tigT8dbH9Cz+c4chHAdeUFwYilkFGCm6a/NblMvw4g='
WHERE
key_id = 'e11dc8b45bc43c1ed8f005f9ca584f0554344b4007fe13abdd050c017602f8a1'
AND (
token = '2tigT8dbH9Cz+c4chHAdeUFwYilkFGCm6a/NblMvw4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)