UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mSDlJvD8IJPfa7Y6TCHZXWqAfXA6n70Q40rD30xzBfs='
WHERE
key_id = '93ece951bb0cad9477236f955d772c0c497a8afc2dcb8fe6b72cae9955a43bed'
AND (
token = 'mSDlJvD8IJPfa7Y6TCHZXWqAfXA6n70Q40rD30xzBfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)