UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1qMTDadlfipd8nSIGkuAUaltQEyrXDDa9xB2/p21jzU='
WHERE
key_id = '0b30e78bb77bff91cbcd417de292be7cc738e146d0d41bed0f1afe6e166df0ec'
AND (
token = '1qMTDadlfipd8nSIGkuAUaltQEyrXDDa9xB2/p21jzU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)