UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hWQB9fcmAdi0Dm02XRNtWoVXbNcXLa9FA6/7DoKOOqI='
WHERE
key_id = 'e11e693096d166bff23816f47e8abde8067c540bad0b9820f441ebe4def77c34'
AND (
token = 'hWQB9fcmAdi0Dm02XRNtWoVXbNcXLa9FA6/7DoKOOqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)