UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QnYYhi2Eg0iOKLKWBx3vn+4QxJ1IVfB+UJFIy09qJLc=' 
WHERE 
  key_id = 'e3ac8a28ca90f5ffe7d92a6ad4f0ba7e26289264a79b073dd7ad6f6f12917aad' 
  AND (
    token = 'QnYYhi2Eg0iOKLKWBx3vn+4QxJ1IVfB+UJFIy09qJLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032