UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nSDtM7sEe48oH9TEAcd4+VpLt4UGwuEV661Aii9yKFs='
WHERE
key_id = '4a7776fba1f89a2918edf3328baa87ab81bf8349c91fafadb0389306dc333826'
AND (
token = 'nSDtM7sEe48oH9TEAcd4+VpLt4UGwuEV661Aii9yKFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)